//
//  WYCSetPassController.m
//  51信用卡
//
//  Created by 中企互联 on 2017/11/3.
//  Copyright © 2017年 中企互联. All rights reserved.
//

#import "WYCZhifusetController.h"
#import "UIButton+CountDown.h"
#import "UIViewController+HUD.h"
#import "passwordView.h"
@interface WYCZhifusetController ()
@property(strong,nonatomic)NSString  *pass;
@end

@implementation WYCZhifusetController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = WYCbgColor;

    self.title = @"支付密码";
    UIView  *payView =[[UIView alloc]initWithFrame:CGRectMake(0, NavHeight, ScreenWidth, 100)];
   
    payView.userInteractionEnabled =YES;
    payView.backgroundColor = [UIColor whiteColor];
    
    [self.view addSubview:payView];
    
    UILabel *payLb = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, ScreenWidth-20, 20)];
    payLb.text =@"请设置支付密码，用于支付验证";
    payLb.backgroundColor = [UIColor clearColor];
    payLb.textColor = [UIColor lightGrayColor];
    payLb.textAlignment = NSTextAlignmentLeft;
    payLb.font = [UIFont systemFontOfSize:13];
    [payView addSubview:payLb];
    
    passwordView *pdView = [[passwordView alloc] initWithFrame:CGRectMake(20, 35, self.view.bounds.size.width-20, 60)];
    pdView.returnPasswordStringBlock = ^(NSString *password){
        NSLog(@"支付密码%@",password);
        self.pass = password;

    };
    [payView addSubview:pdView];
    
    //注册按钮
    UIButton * loginButton = [[UIButton alloc] init];
    loginButton.frame = CGRectMake(30, CGRectGetMaxY(pdView.frame) + 400 * px, ScreenWidth-60, 150 * px);
    loginButton.backgroundColor = wycMain;
    loginButton.layer.cornerRadius = 3;
    [loginButton setTitle:@"确认修改" forState:UIControlStateNormal];
    loginButton.titleLabel.font = [UIFont systemFontOfSize:72 * px];
    [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [loginButton addTarget:self action:@selector(setpasswordClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:loginButton];
}

-(void)setpasswordClick
{
               [self showToast:@"设置支付密码成功"];

//    NSString * httpsStr = [NSString stringWithFormat:@"%@mobile=%@&type=%@",Rcode,self.pass,Ucodekey];
//
//    [HttpTool POST:httpsStr params:nil success:^(NSURLSessionDataTask *task, id responseObject) {
//
//        if ([[responseObject objectForKey:@"code"] intValue] == 0) {
//
//            [self showToast:msgStr];
//
//        }else{
//
//            [self showToast:msgStr];
//        }
//
//    } fail:^(NSURLSessionDataTask *task, NSError *error) {
//
//    }];
    
}
@end

